import { CompareType } from "./Define";

export default class CompareHelper {

    static compare(cur, need, sign) {
        switch (sign) {
            case CompareType.MORE_EQUAL:
                return cur >= need;
            case CompareType.MORE:
                return cur > need;
            case CompareType.LESS:
                return cur < need;
            case CompareType.LESS_EQUAL:
                return cur <= need;
            case CompareType.EQUAL:
                return cur == need;
            case CompareType.NOT_EQUAL:
                return cur != need;
        }
        return false;
    }

}
